<template>
  <div>
    <JzList :records="records" @checkDetail="handleDetail" />
    <Tip @close="isShow = false" :info="info" v-show="isShow" />
  </div>
</template>

<script>
import JzList from '@/components/JzList.vue'
import Tip from '@/components/Tip.vue'
export default {
  data() {
    return {
      info: {},
      isShow: false,
      records: [
        {
          date: '2022-01-01',
          doctor: '张三',
          diagnosis: '感冒',
          prescription: '感冒药',
        },
        {
          date: '2022-02-01',
          doctor: '李四',
          diagnosis: '头疼',
          prescription: '止疼药',
        },
        {
          date: '2022-03-01',
          doctor: '王五',
          diagnosis: '腰痛',
          prescription: '止痛贴',
        },
      ],
    }
  },
  components: {
    JzList,
    Tip,
  },
  methods: {
    handleDetail(index) {
      // console.log('触发1', index)
      this.info = this.records[index]
      this.isShow = true
    },
  },
}
</script>

<style></style>
